-- GENERATED SPELL FOR [Kel'gash the Wicked] --


function spell0_16358(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(28900,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16358', 555, 1)
end

function spell1_16358(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(20802,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16358', 3000, 1)
end

function spell2_16358(pUnit, Event) --@Shrink,n/a--
pUnit:FullCastSpellOnTarget(7289,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16358', 3000, 1)
end

function Sorts_16358(pUnit, Event)
local choix_sorts_16358 = math.random(0, 2)
if choix_sorts_16358 == 0 then
pUnit:RegisterEvent('spell0_16358', 1, 1)
end
if choix_sorts_16358 == 1 then
pUnit:RegisterEvent('spell1_16358', 1, 1)
end
if choix_sorts_16358 == 2 then
pUnit:RegisterEvent('spell2_16358', 1, 1)
end
end

function mob16358_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16358', math.random(1500, 3000), 1)
end

function mob16358_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16358_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16358_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16358, 1, 'mob16358_Action')
RegisterUnitEvent(16358, 2, 'mob16358_Leave')
RegisterUnitEvent(16358, 3, 'mob16358_Kill')
RegisterUnitEvent(16358, 4, 'mob16358_Die')
